<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
    <!-- v-for 可以遍历对象数组，也可以遍历对象, :key 是索引，用于区分不同的元素-->
    <div id="app">
        
        <li v-for="(user, index) in users" :key="user.name">
            当前索引： {{index}} {{user.name}} ==> {{user.age}}  <br>
            对象信息：<span v-for="value in user">{{value}}</span> <br>
            对象键值对信息：<span v-for="(value, key, i) in user"> {{i}}({{key}}, {{value}}) </span>
        </li>

        <ul>
            <li v-for="(num,index) in nums" :key="index">{{num}}</li>
        </ul>

    </div>

    <script src="./node_modules/vue/dist/vue.js"></script>
    <script>
        new Vue({
            el: '#app',
            data:{
                users: [
                    {name: "wangqing", age:20},
                    {name: "tian~", age:20},
                    {name: "xinyu", age:22}
                ],
                nums: [1, 2, 3, 4, 5]
            },
            method: {
                
            }
        });
    </script> 

</body>
</html>
